/**********************************************************************************************/
// dgt_AlgConditions.cpp
//
// Common Lib for Digital Studio
// Block of management of algorithm
// Class, which represent table of conditions of algorithm 
//
// Copyright Diamant Group 2008
/**********************************************************************************************/

#include "dgtKernel.h"
#include "dgt_Log.h"
#include "dgt_AlgConditions.h"
#include <wx/arrimpl.cpp>

/**********************************************************************************************/
WX_DEFINE_OBJARRAY( dgt_AlgCondArray );

/**********************************************************************************************/
dgt_AlgCondition::dgt_AlgCondition(	wxString		inPlugin,
										unsigned		inNum,
										wxArrayString	inOperands)
{
	START( "DgtKernel", "dgt_AlgCondition::dgt_AlgCondition" );

	m_Plugin = inPlugin;
	m_Num = inNum;
	m_Operands = inOperands;

	RETURN_VOID( "dgt_AlgCondition::dgt_AlgCondition" );
}

/**********************************************************************************************/
wxString dgt_AlgCondition::get_Plugin( void )
{
	START( "DgtKernel", "dgt_AlgCondition::get_Plugin" );

	wxString result = this->m_Plugin;

	RETURN( "dgt_AlgCondition::get_Plugin", result );
	return result;
}

/**********************************************************************************************/
unsigned dgt_AlgCondition::get_OpCount( void )
{
	START( "DgtKernel", "dgt_AlgCondition::get_OpCount" );

	unsigned result = this->m_Operands.Count();

	RETURN( "dgt_AlgCondition::get_OpCount", result );
	return result;
}

/**********************************************************************************************/
unsigned dgt_AlgCondition::get_Number( void )
{
	START( "DgtKernel", "dgt_AlgCondition::get_Number" );

	unsigned result = this->m_Num;

	RETURN( "dgt_AlgCondition::get_Number", result );
	return result;
}

/**********************************************************************************************/
wxArrayString dgt_AlgCondition::get_Operands( void )
{
	START( "DgtKernel", "dgt_AlgCondition::get_Operands" );

	wxArrayString result = this->m_Operands;

	RETURN( "dgt_AlgCondition::get_Operands", result );
	return result;
}

/**********************************************************************************************/
wxString dgt_AlgCondition::get_Operand( unsigned inNum )
{
	START( "DgtKernel", "dgt_AlgCondition::get_Operand" );
	LOG_PARAM( inNum );

	wxString result = wxEmptyString;
	if( inNum >= m_Operands.Count() )
		result = m_Operands.Item( inNum );

	RETURN( "dgt_AlgCondition::get_Operand", result );
	return result;
}

/**********************************************************************************************/
void dgt_AlgCondition::set_Plugin( wxString inPlugin )
{
	START( "DgtKernel", "dgt_AlgCondition::set_Plugin" );
	LOG_PARAM( inPlugin );

	m_Plugin = inPlugin;

	RETURN_VOID( "dgt_AlgCondition::set_Plugin" );
}

/**********************************************************************************************/
void dgt_AlgCondition::set_Operands( wxArrayString inOperands )
{
	START( "DgtKernel", "dgt_AlgCondition::set_Operands" );
	LOG_PARAM( inOperands );

	for( unsigned i = 0; i < inOperands.Count(); i++ )
	{
		wxString t_item = inOperands.Item( i );
		m_Operands.Add( t_item );
	}
	
	RETURN_VOID( "dgt_AlgCondition::set_Operands" );
}

/**********************************************************************************************/
void dgt_AlgCondition::set_Number( unsigned inNumber )
{
	START( "DgtKernel", "dgt_AlgCondition::set_Number" );
	LOG_PARAM( inNumber );

	m_Num = inNumber;

	RETURN_VOID( "dgt_AlgCondition::set_Number" );
}
